<%- include common/header%>
  <body>
    <div id="wrap">
    <!-- start navbar -->
	   <%- include common/navbar%>
    <!--  ./end navbar -->
    <!--  昵称和心情 -->
     <div class="container text-center">
     	<h1><%=user.nickname%><p class="small"><span class="glyphicon glyphicon-flag"></span><%=user.moodsign%></p></h1>
     </div>
	 <div class="container">
	  <div class="row">
	     <div class="col-md-3">
  			<!--  代办事情组 -->
  			 <%- include common/leftbar%>
        <!-- ./结束代办事情组 -->
  		 </div>
		 <div class="panel panel-default col-md-9">
          <!-- Default panel contents -->
          <div class="panel-heading">
			       <div class="panel-title">修改密码</div>          
          </div>
          <div class="panel-body">
            <% if(error){ %>
            <div class="alert alert-danger alert-dismissable">
              <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
              <label>Oh,No!</label> <%= error %>
            </div>
           <% } %>
           <% if(success){ %>
            <div class="alert alert-success alert-dismissable">
              <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
              <label>恭喜你!</label><%= success %>
            </div>
           <% } %>
          	<form id="myform" class="form-horizontal" role="form" method="post" action="/u/modifypwd">
            	<div class="form-group">
                	<label for="ltitle" class="col-md-3 control-label">用户名：</label>
                    <div class="col-md-8">
                    	<p class="form-control-static text-left"><%=user.username%></p>
                    </div>
                </div>
                <div class="form-group">
                    <label for="oldPassword" class="col-md-3 control-label">旧密码：</label>
                    <div class="col-md-8">
                      <input type="password" name='oldPassword' class="form-control" id="oldPassword" placeholder="Old Password" check-type="required" minlength="6">
             	 </div>
              </div>
                <div class="form-group">
                    <label for="inputPassword" class="col-md-3 control-label">重设密码：</label>
                    <div class="col-md-8">
                      <input type="password" name='newPassword' class="form-control" id="inputPassword" placeholder="New Password" check-type="required" minlength="6">
             	 </div>
              </div>
               <div class="form-group">
                    <label for="twoPassword" class="col-md-3 control-label">确认密码：</label>
                    <div class="col-md-8">
                    <input type="password" name='twoNewPassword' class="form-control" id="twoPassword" placeholder="Confirm Password" check-type="required" minlength="6">
                    </div>
              </div> 
            </form>
          </div>
          <div class="panel-footer">
          	<button id="uptbtn" type="button" class="btn btn-lg btn-primary btn-block" data-loading-text="正在修改...">确认修改</button>
          </div>
        </div>
	  </div>  <!-- ./end row -->
	 </div>  <!-- ./end container -->
    </div> <!--./end wrap -->
   <%- include common/footer%>
    <script>
      $(function(){
          $('#myform').validation();
          $("#uptbtn").click(function(){
             if($('#myform').valid()){
                $(this).button("loading");
                $("#myform").submit();
             }
          })
      })
  </script>
  </body>
  </html>